package com.graduate.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.graduate.common.entity.Dic;
import com.graduate.common.entity.Handle;
import com.graduate.common.entity.House;
import com.graduate.common.mapper.DicMapper;
import com.graduate.common.service.IDicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.graduate.common.utils.PageUtils;
import com.graduate.common.vo.HandleVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zfy
 * @since 2021-05-09
 */
@Service
public class DicServiceImpl extends ServiceImpl<DicMapper, Dic> implements IDicService {

    @Override
    public IPage<Dic> selectDicPage(Map<String, Object> map) {
        // 设置分页查询对象
        IPage<Dic> page = (IPage<Dic>) PageUtils.convertToPage(map);
        QueryWrapper<Dic> wrapper = new QueryWrapper<>();
        // page为查询出的分页对象
        page = baseMapper.selectPage(page, wrapper);
        // 取出page中的数据转换成VO对象
        List<Dic> records = page.getRecords();
        return page;
    }
}
